import request from '@/utils/request'

// 上传快递公司以及发货仓城市
export function kkTypeCreate (data) {
  return request({
    url: '/v01/kk_type/create',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'

    },
    data: data
  })
}

export function kkTypeUpdate (id, status) {
  return request({
    url: '/v01/kk_type/update/admin',
    method: 'put',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'

    },
    data: {
      id: id,
      status: status
    }
  })
}
// 上传快递单号

export function kkBatchUpload (data) {
  return request({
    url: '/v01/user/kk_batch/upload',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'

    },
    data: data
  })
}
// 确认上传的快递单号
export function kkBatchConfirm (data) {
  return request({
    url: '/v01/user/kk_batch/confirm',
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'

    },
    data: data
  })
}
// 调节金币余额
export function adminAdjust (data) {
  return request({
    url: '/v01/user/order/adjust/admin',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'

    },
    data: data
  })
}
// 确认调账
export function adminAdjustConfirm (data) {
  return request({
    url: '/v01/user/order/confirm',
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'

    },
    data: data
  })
}
export function adminGetAllOrderDetail (params) {
  return request({
    url: '/v01/user/order_detail/all',
    method: 'get',
    params: params
  })
}

export function adminExportAllOrderDetail (params) {
  return request({
    url: '/v01/user/order_detail/download/all',
    method: 'get',
    params: params
  })
}

export function adminGetUserInfo (params) {
  return request({
    url: '/v01/user/user_info/all',
    method: 'get',
    params: params
  })
}

export function updateUserInfo (params) {
  return request({
    url: '/v01/user/user_info/update',
    method: 'put',
    data: params
  })
}

// 上传菜鸟的sessionkey，用于获取菜鸟快递单号
export function adminGetCainiaoExpressNumber (params) {
  return request({
    url: '/v01/user/order_detail/dispatch/admin',
    method: 'get',
    params: params
  })
}

export function fetchPrint (params) {
  return request({
    url: '/v01/user/order_detail/fetch_print/admin',
    method: 'get',
    params: params
  })
}

export function confirmPrint (params) {
  return request({
    url: '/v01/user/order_detail/print_confirm/admin',
    method: 'get',
    params: params
  })
}

export function allStatistics (params) {
  return request({
    url: '/v01/statistics/all',
    method: 'get',
    params: params
  })
}

export function configAll (data) {
  return request({
    url: '/v01/config/list',
    method: 'get',
    params: data
  })
}
